Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

158
Visualizações
Pass paramenter to "Show detail" modal in table

I've made the following dynamic table, which rows are created for each record found in database.

$(document).ready(function () {
var $form = $('#my-form');
$form.submit(function () {
    $.post($(this).attr('action'), $(this).serialize(), function (response) {
        let table = '<table> <thead> <tr> <th>Candidate Name</th> <th>Candidate Surname</th> <th>Interview Type</th> <th>Interview Date</th> <th>Interviewer</th> <th>Feedback</th> </tr> </thead><tbody>';
        response.forEach(function (d) {
            table += '<tr><td>' + d.candidateName + '</td>';
            table += '<td>' + d.candidateSurname + '</td>';
            if (d.interviewType === 1) {
                table += '<td>MOTIVAZIONALE</td>';
            } else if (d.interviewType === 2) {
                table += '<td>TECNICO</td>';
            } else {
                table += '<td></td>';
            }
            if (d.scheduledDate === null) {
                table += '<td></td>';
            } else {
                table += '<td>' + d.scheduledDate + '</td>';
            }
            table += '<td>' + d.enterpriseId + '</td>';
            if (d.finalFeedback === null) {
                table += '<td><button type="button" onclick="sendValue(d.idColloquio)">Add a feedback</button></td></tr>';
            }else{
                table+= '<td>OK</td></tr>';
            }
        })
        table += '</tbody>';
        $('#mytable').empty().html(table);
    }, 'json');
    return false;
});
});

In each row there is a button used to insert a feedback: this button have to redirect in another page by passing the id as a request parameter, but the "onClick" function doesn't work. On Chrome inspector event in generated.

SendValue:

function sendValue(id) {
window.location.href="insertMotivationFeedback?idColloquio="+id;
}

Anyone can help me?

Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have to pass complete url:

window.location.href="https://example.com/insertMotivationFeedback?idColloquio="+id;

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda